package com.vhall.component.controller.interactive.facade;

import com.vhall.component.entity.account.dto.IndexDto;
import com.vhall.component.entity.export.dto.AdminExportCommonQueryCondition;
import com.vhall.component.entity.interactive.vo.QuestionNumReqVO;
import com.vhall.component.entity.interactive.vo.QuestionNumRspVO;
import com.vhall.component.entity.interactive.vo.QuestionPageRspVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author guoxin.wang
 * @date 2021/5/11
 */
@FeignClient(value = "QuestionInnerFacade", path = "/v4/inner/question")
public interface QuestionInnerFacade {

    /**
     * 问卷-获取列表
     * 开播后的参加问卷的账号列表
     *
     * @param roomId     房间id
     * @param startTime  开始时间
     * @param page       页数
     * @param pageSize   每页大小
     * @param queryCount 是否查总数
     * @return 返回值
     */
    @GetMapping(value = "/ques-accounts")
    QuestionPageRspVO<Integer> queryQuesAccounts(@RequestParam("roomId") String roomId, @RequestParam("startTime") String startTime,
                                                 @RequestParam("page") int page, @RequestParam("pageSize") int pageSize, @RequestParam("queryCount") boolean queryCount);

    /**
     * 问卷-获取房间开播后参加问卷的人数
     *
     * @param roomId    房间id
     * @param startTime 开始时间
     * @return 返回值
     */
    @GetMapping(value = "/ques-partake-total")
    Integer queryAllPartakeAccountsCount(@RequestParam("roomId") String roomId, @RequestParam("startTime") String startTime);

    /**
     * 获取数据条数
     *
     * @param beginTime
     * @return
     */
    @GetMapping("/getCounts")
    IndexDto getCount(String beginTime);

    @GetMapping("/get-question-num")
    QuestionNumRspVO getQuestionNum(QuestionNumReqVO reqVO);

    /**
     * 针对admin导出计算总条数
     *
     * @param condition 查询条件
     * @return 总条数
     */
    @PostMapping("/count-for-admin-export")
    Integer countForAdminExport(@RequestBody AdminExportCommonQueryCondition condition);
}
